<?php 
	$this->session->set_flashdata('num',10);
	$semanaFiltro = $this->session->userdata('semanaActual');
?>
<script type="text/javascript">
jQuery(document).ready(function(){
	filtroSemana = document.getElementById("cantSemana").value;
	jQuery('#list').jqGrid({
		url: '<?=site_url()?>/indicadoresgonapi/getData/'+filtroSemana,
		mtype: 'POST',
        datatype: 'json',
        colNames:['ID','Referencia', 'Tipo','C. Servicio','Registro','Etapa A.','Dias en Etapa','Etapa',
                  'Total','User','Responsable'],
        colModel :[
                   {name:'IdCompania', index:'IdCompania', width:5,hidden:true},
                   {name:'NombreCompania', index:'NombreCompania', width:80},
                   {name:'IdServicio', index:'IdServicio', width:40},
                   {name:'cServicio', index:'clasificacion_servicios', width:30},
                   {name:'FechaUsrCompania', index:'FechaUsrCompania', width:40},
                   {name:'IdEtapa',index:'idStatu',width:35},
                   {name:'dias', index:'dias', width:40},
                   {name:'Etapa', index:'Etapa', width:32},
                   {name:'Total', index:'Total', width:32},
                   {name:'User', index:'IdUsuario', width:35},
                   {name:'Responsable', index:'Responsable', width:40}],
            pager: jQuery('#pager'),
            hiddengrid: false,
            sortname: 'FechaSysCompania',
            rowNum:5,       
            rowList:[5,5,5,5,5],
            sortorder: "ASC",
            height: '100%',
            width: '875',
            imgpath: _base_url + 'public/css/jqgrid/flex/images',
            viewrecords: true,
            multiselect: true,
            onSelectRow: function(ids) 
            {
            	if(ids != null) 
            	{
            		var rec = jQuery("#list").getRowData(ids);
            		lol=ids;
            	}
            },
            adjacents: 4,
            jsonReader: { repeatitems : false, id_Categoria: "0"}
	});
	
});
</script>
<?php echo form_open('indicadoresgonapi/', array('name' => 'filterForm','id' => 'filterForm'));?>
<div class="table_container">

<table>
   <tr>
      <td><div id="titulo">Top 5 Compa&ntilde;ias mas viejas (ONAPI y OBJETADO)</div></td>
   </tr>
   <tr>
       <td style="background: #D9E6F0;border: 1px solid #C3AA64; height: 23px">&nbsp; 
              <b>Semanas:<b/>
                     <select name="cantSemana" id="cantSemana">
				           <option value="9"  <?php if ($semanaFiltro == 9):?>selected="selected"<?php endif;?>>10</option>
				           <option value="15" <?php if ($semanaFiltro == 15):?>selected="selected"<?php endif;?>>16</option>
				           <option value="25" <?php if ($semanaFiltro == 25):?>selected="selected"<?php endif;?>>26</option>
				           <option value="51" <?php if ($semanaFiltro == 51):?>selected="selected"<?php endif;?>>52</option>
			         </select>
                      <input type="submit" value="Buscar" id="btnBuscar"/><br/><br/>
                <?php if($this->session->userdata('semanaActual')):?>
 	  						<b style="color:blue">Semana:</b>
                            <b style="color:red"><?php echo "El numero de Semana es: ".$semanaFiltro+=1; ?></b>
 				<?php endif;?>
        </td>
   </tr>
<tr>
<td>
<table id="list" class="scroll">
 </table>
   <div id="pager" class="scroll" style="text-align:center;">
    </div>
</td>
 </tr>
</table>
</div>

<?php $this->load->view('graficosgonapi_view', $detalles_gonapi, $detalles_retrazo)?>